package com.ruoyi.good.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.good.mapper.GoodMenuMapper;
import com.ruoyi.good.domain.GoodMenu;
import com.ruoyi.good.service.IGoodMenuService;

/**
 * 商品类目Service业务层处理
 * 
 * @author xg
 * @date 2025-04-04
 */
@Service
public class GoodMenuServiceImpl implements IGoodMenuService 
{
    @Autowired
    private GoodMenuMapper goodMenuMapper;

    /**
     * 查询商品类目
     * 
     * @param id 商品类目主键
     * @return 商品类目
     */
    @Override
    public GoodMenu selectGoodMenuById(Long id)
    {
        return goodMenuMapper.selectGoodMenuById(id);
    }

    /**
     * 查询商品类目列表
     * 
     * @param goodMenu 商品类目
     * @return 商品类目
     */
    @Override
    public List<GoodMenu> selectGoodMenuList(GoodMenu goodMenu)
    {
        return goodMenuMapper.selectGoodMenuList(goodMenu);
    }

    /**
     * 新增商品类目
     * 
     * @param goodMenu 商品类目
     * @return 结果
     */
    @Override
    public int insertGoodMenu(GoodMenu goodMenu)
    {
        goodMenu.setCreateTime(DateUtils.getNowDate());
        return goodMenuMapper.insertGoodMenu(goodMenu);
    }

    /**
     * 修改商品类目
     * 
     * @param goodMenu 商品类目
     * @return 结果
     */
    @Override
    public int updateGoodMenu(GoodMenu goodMenu)
    {
        goodMenu.setUpdateTime(DateUtils.getNowDate());
        return goodMenuMapper.updateGoodMenu(goodMenu);
    }

    /**
     * 批量删除商品类目
     * 
     * @param ids 需要删除的商品类目主键
     * @return 结果
     */
    @Override
    public int deleteGoodMenuByIds(Long[] ids)
    {
        return goodMenuMapper.deleteGoodMenuByIds(ids);
    }

    /**
     * 删除商品类目信息
     * 
     * @param id 商品类目主键
     * @return 结果
     */
    @Override
    public int deleteGoodMenuById(Long id)
    {
        return goodMenuMapper.deleteGoodMenuById(id);
    }
}
